﻿using System;
using WindowsGame.Builder;
using WindowsGame.Device;
using WindowsGame.Input;
using WindowsGame.Manager;
using WindowsGame.Library;
using WindowsGame.Library.Data;
using WindowsGame.Library.IoC;
using WindowsGame.Library.Logger;
using WindowsGame.Library.ProxyObjects;

#if WINDOWS
using WindowsGame.Logger;
#endif

namespace WindowsGame.Static
{
	public static class Registration
	{
		public static void Initialize()
		{
			IoCContainer.Initialize<IGameManager, GameManager>();

			IoCContainer.Initialize<ICamera, Camera>();
			IoCContainer.Initialize<IDataManager, DataManager>();
			IoCContainer.Initialize<IDeviceManager, DeviceManager>();
			IoCContainer.Initialize<IGameObjectManager, GameObjectManager>();
			IoCContainer.Initialize<IInputManager, InputManager>();
			IoCContainer.Initialize<IScreenManager, ScreenManager>();

			IoCContainer.Initialize<IFileProxy, FileProxy>();
			IoCContainer.Initialize<IFileManager, FileManager>();

			IoCContainer.Initialize<GameObjectBuilder, GameObjectBuilder>();
			IoCContainer.Initialize<IGameObjectManager, GameObjectManager>();
			IoCContainer.Initialize<ProxyObjectBuilder, ProxyObjectBuilder>();
			IoCContainer.Initialize<IProxyObjectManager, ProxyObjectManager>();

#if WINDOWS_PHONE
			IoCContainer.Initialize<IGameLogger, TestLogger>();
			IoCContainer.Initialize<ADeviceFactory, PhoneDeviceFactory>();
			IoCContainer.Initialize<IInputFactory, PhoneInputFactory>();
#elif WINDOWS
			IoCContainer.Initialize<IGameLogger, WorkLogger>();
			IoCContainer.Initialize<ADeviceFactory, WorkDeviceFactory>();
			IoCContainer.Initialize<IInputFactory, WorkInputFactory>();
#elif XBOX
			IoCContainer.Initialize<IGameLogger, TestLogger>();
			IoCContainer.Initialize<ADeviceFactory, XboxDeviceFactory>();
			IoCContainer.Initialize<IInputFactory, XboxInputFactory>();
#else
			throw new ArgumentOutOfRangeException("Environment");
#endif
		}
	}
}
